local t = Def.ActorFrame {};

if not GAMESTATE:IsCourseMode() then

t[#t+1] = Def.ActorFrame {
	InitCommand=cmd(Center;);
	OnCommand=cmd(zoom,0.8;diffusealpha,0;decelerate,0.7;zoom,1;diffusealpha,1;);
	OffCommand=cmd(decelerate,0.7;zoom,1.1;diffusealpha,0);
	LoadActor("_bgmask") .. {
		InitCommand=cmd(blend,"BlendMode_NoEffect";zwrite,true;clearzbuffer,true;);
	};	
	Def.Quad {
		InitCommand=cmd(diffuse,color("#000000");zoomto,SCREEN_WIDTH,SCREEN_HEIGHT;ztest,true);
	};	
	Def.Sprite {
		name="SongBG";
		InitCommand=cmd(ztest,true;addy,20;);
		ChangedCommand=cmd(finishtweening;);
        CurrentSongChangedMessageCommand=cmd(playcommand,"Set"); 
        CurrentCourseChangedMessageCommand=cmd(playcommand,"Set"); 
        TransitionCommand=cmd(finishtweening;zoom,0.9;diffusealpha,0;decelerate,0.4;zoom,1;diffusealpha,0.4;);
		SetCommand=function(self) 
            local song = GAMESTATE:GetCurrentSong(); 
			if song then
                if song:HasBackground() then
					self:finishtweening()
					self:linear(0.2):diffusealpha(0)
                    self:Load(song:GetBackgroundPath()):scaletoclipped(729,410)
					self:playcommand("Transition")
					if song:HasPreviewVid() then
						self:sleep(0.8)
						self:decelerate(0.5)
						self:diffusealpha(0)
					end
				else
					self:diffusealpha(0)
				end;
			end;
		end;
	};
	
	Def.Sprite {
        name="PreviewVideo";
		InitCommand=cmd(scaletoclipped,729,410;ztest,true);
        CurrentSongChangedMessageCommand=cmd(playcommand,"Set");
        SetCommand=function(self)
        local song = GAMESTATE:GetCurrentSong();
            if song then
					if song:HasPreviewVid() then
						self:diffusealpha(0)
						self:zoomx(1)
						self:Load(song:GetPreviewVidPath())
						self:sleep(0.8)
						self:decelerate(0.5)
						self:diffusealpha(0.6)
					else
						self:stoptweening()
						self:decelerate(0.3)
						self:diffusealpha(0)
					end
				end
		end;
	};
	LoadActor("_ringcover") .. {
	};	
};

end

return t